package biz;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
public class BizException extends RuntimeException {
    private Object data;

    public BizException(String message, Object... data) {
        this(message, null, data);
    }

    public BizException(String message, Throwable cause, Object... data) {
        super(message, cause);
        this.data = data.length == 0 ? null : data.length == 1 ? data[0] : data;
    }
}
